package com.ujson.chat.common.dto;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * <h3>ujson-parent</h3>
 * <p>用户信息</p>
 *
 * @author JerryLiu  a1031757312@gmail.com
 * @version 1.0
 * @date 2021-11-23 22:03
 */
@Data
@AllArgsConstructor
public class UserDto {
    private String uid;
    private String username;
    private String password;

    public UserDto(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public static UserDto create(String inputString) {
        String[] arr = inputString.split("@");
        return new UserDto(arr[0], arr[1]);
    }
}
